package com.financing.wap.dao.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.financing.wap.common.SqlName;
import com.financing.wap.dao.IForegroundProductDao;
import com.financing.wap.dto.ForegroundProductDTO;
import com.financing.wap.dto.OutProductDTO;



@Repository("foregroundProductDao")
@SuppressWarnings(value={"unchecked", "deprecation"})
public class ForegroundProductDaoImpl extends BaseDaoImpl<ForegroundProductDTO, java.lang.Integer> implements IForegroundProductDao {

	@Override
	public Class<ForegroundProductDTO> getEntityClass() {
		return ForegroundProductDTO.class;
	}

	@Override
	public int addForegroundProduct(ForegroundProductDTO foregroundProductDto) {
		return (Integer) this.sqlMapClientTemplate.insert(sqlName.addForegroundProduct,foregroundProductDto);
	}

	@Override
	public List<ForegroundProductDTO> queryForegroundProduct(
			ForegroundProductDTO foregroundProductDto) {
		return this.sqlMapClientTemplate.queryForList(sqlName.queryforegroundProduct,foregroundProductDto);
	}

	@Override
	public int updateOutProduct(OutProductDTO outProductDto) {
		return this.sqlMapClientTemplate.update(SqlName.updateOutProduct,outProductDto);
	}

	@Override
	public int updateForegroundProduct(ForegroundProductDTO foregroundProductDto) {
		return this.sqlMapClientTemplate.update(SqlName.updateForegroundProduct,foregroundProductDto);
	}

	@Override
	public int countForegroundProduct(ForegroundProductDTO foregroundProductDto) {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.countForegroundProduct,foregroundProductDto);
	}

	@Override
	public int updateProjectAnnualRevenueByendAmount(Map<String, Object> map)
			throws SQLException {
		return (Integer) this.sqlMapClientTemplate.update(SqlName.updateProjectAnnualRevenueByendAmount,map);
	}

	@Override
	public int addForegroundProductLog(OutProductDTO outProductDto) {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.addForegroundProductLog,outProductDto);
	}

	
}
